package com.mpsc.lcn.consumer.controller;


import com.codingapi.txlcn.tc.annotation.DTXPropagation;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.mpsc.api.bean.RoleInfoEntity;
import com.mpsc.lcn.consumer.service.RoleInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/roleInfo")
@Api(value = "RoleInfoController", tags = "角色管理")
public class RoleInfoController {

    @Autowired
    private RoleInfoService roleInfoService;

    @PatchMapping("/save")
    @ApiOperation("保存角色信息")
    @LcnTransaction(propagation= DTXPropagation.REQUIRED)
    public void save(@RequestBody RoleInfoEntity role) {
        roleInfoService.saveRoleInfo(role);
    }

}
